3.1.9 \(\int \csc (c+d x) (a-a \csc (c+d x)) (A+A \csc (c+d x)) \, dx\) [9]

Optimal. Leaf size=38 \[ -\frac {a A \tanh ^{-1}(\cos (c+d x))}{2 d}+\frac {a A \cot (c+d x) \csc (c+d x)}{2 d} \]

[Out]

-1/2*a*A*arctanh(cos(d*x+c))/d+1/2*a*A*cot(d*x+c)*csc(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used = {4043, 2691, 3855} \begin {gather*} \frac {a A \cot (c+d x) \csc (c+d x)}{2 d}-\frac {a A \tanh ^{-1}(\cos (c+d x))}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[c + d*x]*(a - a*Csc[c + d*x])*(A + A*Csc[c + d*x]),x]

[Out]

-1/2*(a*A*ArcTanh[Cos[c + d*x]])/d + (a*A*Cot[c + d*x]*Csc[c + d*x])/(2*d)

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4043

Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_)
)^(n_.), x_Symbol] :> Dist[((-a)*c)^m, Int[ExpandTrig[csc[e + f*x]*cot[e + f*x]^(2*m), (c + d*csc[e + f*x])^(n
 - m), x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IntegersQ[m,
 n] && GeQ[n - m, 0] && GtQ[m*n, 0]

Rubi steps

\begin {align*} \int \csc (c+d x) (a-a \csc (c+d x)) (A+A \csc (c+d x)) \, dx &=-\left ((a A) \int \cot ^2(c+d x) \csc (c+d x) \, dx\right )\\ &=\frac {a A \cot (c+d x) \csc (c+d x)}{2 d}+\frac {1}{2} (a A) \int \csc (c+d x) \, dx\\ &=-\frac {a A \tanh ^{-1}(\cos (c+d x))}{2 d}+\frac {a A \cot (c+d x) \csc (c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(79\) vs. \(2(38)=76\).
time = 0.04, size = 79, normalized size = 2.08 \begin {gather*} -a A \left (-\frac {\csc ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}+\frac {\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}-\frac {\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}+\frac {\sec ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[c + d*x]*(a - a*Csc[c + d*x])*(A + A*Csc[c + d*x]),x]

[Out]

-(a*A*(-1/8*Csc[(c + d*x)/2]^2/d + Log[Cos[(c + d*x)/2]]/(2*d) - Log[Sin[(c + d*x)/2]]/(2*d) + Sec[(c + d*x)/2
]^2/(8*d)))

________________________________________________________________________________________

Maple [A]
time = 0.09, size = 62, normalized size = 1.63

method result size
norman \(\frac {\frac {A a}{8 d}-\frac {A a \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\frac {A a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}\) \(57\)
derivativedivides \(\frac {-A a \left (-\frac {\csc \left (d x +c \right ) \cot \left (d x +c \right )}{2}+\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+A a \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}\) \(62\)
default \(\frac {-A a \left (-\frac {\csc \left (d x +c \right ) \cot \left (d x +c \right )}{2}+\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+A a \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}\) \(62\)
risch \(-\frac {A a \left ({\mathrm e}^{3 i \left (d x +c \right )}+{\mathrm e}^{i \left (d x +c \right )}\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}+\frac {A a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d}-\frac {A a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d}\) \(79\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(d*x+c)*(a-a*csc(d*x+c))*(A+A*csc(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(-A*a*(-1/2*csc(d*x+c)*cot(d*x+c)+1/2*ln(csc(d*x+c)-cot(d*x+c)))+A*a*ln(csc(d*x+c)-cot(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 68, normalized size = 1.79 \begin {gather*} -\frac {A a {\left (\frac {2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + 4 \, A a \log \left (\cot \left (d x + c\right ) + \csc \left (d x + c\right )\right )}{4 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a-a*csc(d*x+c))*(A+A*csc(d*x+c)),x, algorithm="maxima")

[Out]

-1/4*(A*a*(2*cos(d*x + c)/(cos(d*x + c)^2 - 1) - log(cos(d*x + c) + 1) + log(cos(d*x + c) - 1)) + 4*A*a*log(co
t(d*x + c) + csc(d*x + c)))/d

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 86 vs. \(2 (34) = 68\).
time = 3.54, size = 86, normalized size = 2.26 \begin {gather*} -\frac {2 \, A a \cos \left (d x + c\right ) + {\left (A a \cos \left (d x + c\right )^{2} - A a\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (A a \cos \left (d x + c\right )^{2} - A a\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{4 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a-a*csc(d*x+c))*(A+A*csc(d*x+c)),x, algorithm="fricas")

[Out]

-1/4*(2*A*a*cos(d*x + c) + (A*a*cos(d*x + c)^2 - A*a)*log(1/2*cos(d*x + c) + 1/2) - (A*a*cos(d*x + c)^2 - A*a)
*log(-1/2*cos(d*x + c) + 1/2))/(d*cos(d*x + c)^2 - d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - A a \left (\int \left (- \csc {\left (c + d x \right )}\right )\, dx + \int \csc ^{3}{\left (c + d x \right )}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a-a*csc(d*x+c))*(A+A*csc(d*x+c)),x)

[Out]

-A*a*(Integral(-csc(c + d*x), x) + Integral(csc(c + d*x)**3, x))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 101 vs. \(2 (34) = 68\).
time = 0.44, size = 101, normalized size = 2.66 \begin {gather*} \frac {2 \, A a \log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right ) + \frac {A a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {{\left (A a + \frac {2 \, A a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}}{\cos \left (d x + c\right ) - 1}}{8 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a-a*csc(d*x+c))*(A+A*csc(d*x+c)),x, algorithm="giac")

[Out]

1/8*(2*A*a*log(abs(-cos(d*x + c) + 1)/abs(cos(d*x + c) + 1)) + A*a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1) - (A*
a + 2*A*a*(cos(d*x + c) - 1)/(cos(d*x + c) + 1))*(cos(d*x + c) + 1)/(cos(d*x + c) - 1))/d

________________________________________________________________________________________

Mupad [B]
time = 0.26, size = 56, normalized size = 1.47 \begin {gather*} \frac {A\,a\,\left (4\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+1\right )}{8\,d\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + A/sin(c + d*x))*(a - a/sin(c + d*x)))/sin(c + d*x),x)

[Out]

(A*a*(4*log(tan(c/2 + (d*x)/2))*tan(c/2 + (d*x)/2)^2 - tan(c/2 + (d*x)/2)^4 + 1))/(8*d*tan(c/2 + (d*x)/2)^2)

________________________________________________________________________________________